package nc.hw;

public class HJ31 {

    private static String revertWord(String word) {
        String[] split = word.split("[^a-zA-Z]");
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = split.length - 1; i >= 0; i--) {
            stringBuilder.append(split[i]).append(" ");
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(revertWord("$bo*y gi!r#l"));
    }

}
